package com.hs.srm.admin.modules.material.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.hs.srm.base.common.annotation.DictMapping;
import com.hs.srm.base.common.base.CloneableEntity;
import com.hs.srm.base.common.utils.DictDataUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/*
 * 物料领用表
 */
@Setter
@Getter
@TableName("material_lead_back")
@ToString
public class MaterialLeadBackEntity implements Serializable, CloneableEntity<MaterialLeadBackEntity> {

    private static final long serialVersionUID = 1L;

    public MaterialLeadBackEntity() {
        super();
    }

    /*
     * 主键ID
     */
    @TableId(value = "material_lead_id", type = IdType.UUID)
    @TableField("material_lead_id")
    @Excel(name = "主键ID", orderNum = "1")
    private String materialLeadId;

    /*
     * 物料号
     */

    @TableField("material_code")
    @Excel(name = "物料号", orderNum = "2")
    private String materialCode;

    /*
     * 工厂
     */
    @DictMapping(type = DictDataUtil.DictType.GC)
    @TableField("werks")
    @Excel(name = "工厂", orderNum = "3")
    private String werks;

    /*
     * 领用人
     */
    @TableField("leadMan")
    @Excel(name = "领用人", orderNum = "4")
    private String leadMan;
    /*
     * 账户组
     */
    @TableField("account")
    @Excel(name = "账号", orderNum = "13")
    private String account;

    /*
     * 领用部门
     */
    @DictMapping(type = DictDataUtil.DictType.LYBM)
    @TableField("leadDept")
    @Excel(name = "领用部门", orderNum = "5")
    private String leadDept;

    /*
     * 领用数量
     */
    @TableField("leadnum")
    @Excel(name = "领用数量", orderNum = "6")
    private Integer leadnum;

    /*
     * 领用时间
     */
    @TableField("createtime")
    @Excel(name = "领用时间", orderNum = "7")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date createtime;

    /*
     * 预计归还时间
     */
    @TableField("returntime")
    @Excel(name = "预计归还时间", orderNum = "8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date returntime;

    /*
     * 实际归还时间
     */
    @TableField("actualtime")
    @Excel(name = "实际归还时间", orderNum = "9")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date actualtime;

    /*
     * 归还人
     */
    @TableField("retrunman")
    @Excel(name = "归还人", orderNum = "10")
    private String retrunman;

    /*
     * 归还人部门
     */
    @TableField("returnDept")
    @Excel(name = "归还人部门", orderNum = "11")
    @DictMapping(type = DictDataUtil.DictType.KCDD)
    private String returnDept;
    /*
     * 归还数量
     */
    @TableField("returnNum")
    @Excel(name = "归还数量", orderNum = "12")
    private Integer returnNum;
    /**
     * @Description: 归还类型
     */
    @TableField(exist = false)
    private int returnType;
    /**
     * @Description: 物料描述
     */
    @TableField(exist = false)
    private String materialDesc;
    /**
     * @Description: 可用数量
     */
    @TableField(exist = false)
    private int usecont;

    @Override
    public MaterialLeadBackEntity clone() {
        try {
            return (MaterialLeadBackEntity) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
}
